package org.nanotek.base.calendar;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;

/**
 * 
 * @author josecanova
 *
 */
@Entity
//@EntityListeners(org.nanotek.base.date.jpa.MinuteBaseEventListener.class)
@SuppressWarnings("serial")
public class MinuteBase extends Datable {
	
	private Integer second; 
	
	private Integer millisecond; 
	
	public MinuteBase(){
	} 
	
	public Integer getSecond() {
		return second;
	}
	
	public void setSecond(Integer second) {
		this.second = second;
	}
	
	public Integer getMillisecond() {
		return millisecond;
	}
	
	public void setMillisecond(Integer milisecond) {
		this.millisecond = milisecond;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((millisecond == null) ? 0 : millisecond.hashCode());
		result = prime * result + ((second == null) ? 0 : second.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MinuteBase other = (MinuteBase) obj;
		if (millisecond == null) {
			if (other.millisecond != null)
				return false;
		} else if (!millisecond.equals(other.millisecond))
			return false;
		if (second == null) {
			if (other.second != null)
				return false;
		} else if (!second.equals(other.second))
			return false;
		return true;
	}
	
}
